﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Template/Site_Main.Master" AutoEventWireup="true"
    CodeBehind="sys_log.aspx.cs" Inherits="RegisterationSystem.Space_Education.sys_log" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
      <!--
        $(function () {
            //设置导航位置
            setLocalToParent();
            //初始化隐藏层
            $('#plastudentinfo').dialog({   
                closed: true
            });
            var products = <%=ShcJson %>;
          
            //初始化企业用户数据列表控件
            $("#dg").datagrid({
                idField: "logid",      //标识字段,主键
                url: "../SyncService/GetDataList.ashx?action=getsysloglist",
                queryParams: { "where": "1=1"},
                pagination: true,   //是否开启分页
                rownumbers: true,   //行号
                pageSize: 10,
                pageNumber: 1,
                columns: [[
                            { field: 'ck', checkbox: true },
                            { field: 'operator', title: '操作员', width: 130, align: 'center' },
                              { field: 'logtime', title: '操作时间', width: 130, align: 'center' },
                               { field: 'ip', title: 'IP', width: 130, align: 'center' },
                                { field: 'typename', title: '日志类型', width: 130, align: 'center' },
                                 { field: 'remark', title: '备注', width: 130, align: 'center' },
                            { field: 'logid', title: '操作', width: 150,align: 'center', formatter: function (value, row) {
                                return "<a href='javascript:void(0)'  onclick='delstudentByID("+value+");'>删除</a>";
                            }
                            }
                         ]]
            })
        });
        //-->
      //查询
        function SelDistributedStuList()
        {
            var where ="";
            where +=$("#txtname").val()+",";//操作员
              where+=$("#startTime").datebox('getValue')+",";//操作时间开始
            where+=$("#EndTime").datebox('getValue')+",";//操作时间结束
            where+=$("#txtIp").val()+",";//IP
            where+=$("#<%= dllTypeName.ClientID %>").combobox("getValue")+"";//日志类型
            $('#dg').datagrid({ url: "../SyncService/GetDataList.ashx?action=getsysloglist", queryParams: { "where": where} });
            $('#dg').datagrid('reload');
        }
        //根据ID删除学生
        function delstudentByID(id) {
            $.messager.confirm('提示', "是否确认删除？", function (r) {
                if (r) {
                    $.post(location.href, { "action": "delstudentByID", "id": id }, function (data) {
                        $.messager.alert("消息提示", "删除成功!");
                        $('#dg').datagrid('reload');
                    });
                }
            });
        }
     //批量删除
        function delstudentlist() {
            //id集合
            var ids = "";
            //获取选择集合
            var rows = $('#dg').datagrid('getSelections');
            if (rows.length == 0) {
                alert("请选择行");
                return;
            }
            //遍历选择行
            for (var i = 0; i < rows.length; i++) {
                ids += rows[i].logid + ",";
            }
            //alert(ids);
            $.messager.confirm('提示', '确认删除？', function (r) {
                if (r) {
                    $.post(location.href, { "action": "delstudentlist", "id": ids }, function (data) {
                        $.messager.alert("消息提示", "删除成功！");
                        $('#dg').datagrid('reload');
                    });
                }
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Place_Local" runat="server">
    <div class="localTitle">
        <a>操作日志管理</a>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!--选择的学生信息编号-->
    <asp:HiddenField ID="hidstuID" runat="server" />
    <div class="loadheight">
        <table width="100%%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td bgcolor="#FFFFFF">
                    <table width="100%%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                </table>
                            </td>
                        </tr>
                    </table>
                    <table width="100%%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="cen_R_dh">
                                <strong>操作日志查询</strong>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <table width="100%" border="0" cellpadding="0" cellspacing="1">
                                    <tr>
                                        <td height="20">
                                            <table width="100%%" border="0" cellspacing="0" cellpadding="3">
                                            </table>
                                            <div style="margin-top: 5px">
                                            </div>
                                            <table width="688" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
                                                <tr>
                                                    <td width="100" height="20" align="center" bgcolor="#FFFFFF">
                                                        操作员
                                                    </td>
                                                    <td width="200" bgcolor="#FFFFFF">
                                                        <input type="text" id="txtname" style="width: 130px;" class="easyui-validatebox"
                                                            maxlength="10" />
                                                    </td>
                                                    <td width="100" align="center" bgcolor="#FFFFFF">
                                                        <span>日志类型</span>
                                                    </td>
                                                    <td align="left" bgcolor="#FFFFFF">
                                                        <asp:DropDownList ID="dllTypeName" runat="server" class="easyui-combobox" data-options="required:true,editable:false">
                                                        </asp:DropDownList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width="100" align="center" bgcolor="#FFFFFF">
                                                        操作时间
                                                    </td>
                                                    <td align="left" bgcolor="#FFFFFF">
                                                        <input type="text" id="startTime" style="width: 120px; height: 20px;" class="easyui-datebox"
                                                            data-options="editable:false" />-<input type="text" id="EndTime" style="width: 120px;
                                                                height: 20px;" class="easyui-datebox" data-options="editable:false" />
                                                    </td>
                                                    <td width="100" align="center" bgcolor="#FFFFFF">
                                                        IP
                                                    </td>
                                                    <td align="left" bgcolor="#FFFFFF">
                                                        <input type="text" id="txtIp" style="width: 130px;" class="easyui-validatebox" maxlength="10" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <div style="margin-top: 5px">
                    </div>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="200">
                                &nbsp;
                            </td>
                            <td>
                                <input type="button" name="button" id="button" value="查询" class="anniu" width="73"
                                    height="27" onclick="SelDistributedStuList();" />
                            </td>
                        </tr>
                    </table>
                    <div style="height: 5px;">
                    </div>
                    <table width="100%%" border="0" cellspacing="0" cellpadding="1">
                        <tr>
                            <td class="cen_R_dh">
                                <strong>操作日志管理</strong>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <!-- 创建数据列表控件 -->
                                <table id="dg">
                                </table>
                                <br />
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td align="left">
                                            <input type="button" name="button2" id="button2" value="删除" class="anniu" width="73px"
                                                height="23px" onclick="delstudentlist();" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
